home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 72 / maccd 72.iso / online / NetFinder 2.1.2 ƒ / NetFinder Script Components / Modules / Module Doco / Inside MICI Module.txt < prev    next >
Encoding:
Text File  |  2000-02-20  |  4.1 KB  |  132 lines  |  [TEXT/R*ch]

  1. (c) 2000 Peter Li, All Rights Reserved.
  2. =======================================
  3.  
  4.  
  5. This module provides some routines that are mostly specific to MacICI (MICI).
  6.  
  7.  
  8. Standard Lib Routines
  9. =====================
  10.  
  11. LoadModuleConstants();
  12.  
  13. Description: Loads constants used by MICI Module to make scripts
  14.              more readable.
  15. Parameters:  none
  16. Returns:     null
  17.  
  18. -----------------------------
  19.  
  20. GetModuleVersion();
  21.  
  22. Description: Returns the version of this module.
  23. Parameters:  none
  24. Returns:     null
  25.  
  26.  
  27.  
  28. MICI Routines
  29. =============
  30.  
  31. Alert(int inAlertType, string inAlertText);
  32.  
  33. Description: This puts up a standard alert to the user.
  34. Parameters:  inAlertType - type of alert:
  35.                    STOPALERT = 0 => Stop Alert
  36.                    NOTEALERT = 1 => Note Alert
  37.                    CAUTIONALERT = 2 => Caution Alert
  38.              inAlertText - text to appear in alert.
  39. Returns:     null
  40.  
  41. Example:     MICI.Alert(STOPALERT, "Disk is full.");
  42.  
  43. -----------------------------
  44.  
  45. int = Ask(string inQuestion, string inDefaultAnswer, string* outUsersAnswer);
  46.  
  47. Description: Prompts the user to enter some data.
  48. Parameters:  inQuestion - message to display to the user.
  49.              inDefaultAnswer - a default input.
  50.              outUsersAnswer - input the user entered. Only valid if user did
  51.                    not cancel.
  52. Returns:     1 = user cancelled, 0 = user did not cancel.
  53.  
  54. Example:     string outUsersAnswer;
  55.              if (MICI.Ask("Please enter an amount:", "50", &outUsersAnswer) == 1)
  56.                  printf("User cancelled.");
  57.  
  58. -----------------------------
  59.  
  60. int = Answer(string inQuestion [, string inOKButtonTxt, string inCancelButtonTxt]);
  61.  
  62. Description: Prompts the user, and waits for an answer (eg OK or cancel).
  63. Parameters:  inQuestion - message to display to the user.
  64.              inOKButtonTxt - optional, override the default "OK" text.
  65.              inCancelButtonTxt - optional, override the default "cancel" text.
  66. Returns:     1 = user hit "cancel", 0 = user hit "OK".
  67.  
  68. Example:     int reply;
  69.              reply = MICI.Answer("Is it wet outside?", "Yes", "No");
  70.              if (reply == 0)
  71.                  printf("User pressed Yes");
  72.  
  73. -----------------------------
  74.  
  75. int = SetFileTypeCreator(struct inSpec, string inType, string inCreator);
  76. int = SetFileTypeCreator(string inPath, string inType, string inCreator);
  77.  
  78. Description: Sets the Type/Creator of a specificed file.
  79. Parameters:  inSpec - a valid FSSpec.
  80.              inPath - a path to a file.
  81.              inType - 4 char type ID.
  82.              inCreator - 4 char creator ID.
  83. Returns:     returns any errors that occured or zero for no error.
  84.  
  85. Example:     int err = MICI.SetFileTypeCreator("HD:report.txt", "TEXT", "ttxt");
  86.  
  87. -----------------------------
  88.  
  89. int = OpenObject(struct inSpec [, string inCreator]);
  90. int = OpenObject(string inPath [, string inCreator]);
  91.  
  92. Description: Opens a file/folder using the specified application.
  93. Parameters:  inSpec - a valid FSSpec.
  94.              inPath - a path to a file/folder.
  95.              inCreator - optional, creator ID of application to open the
  96.                    specified file/folder. Defaults to "MACS" which is
  97.                    the Finder.
  98. Returns:     returns any errors that occured or zero for no error.
  99.  
  100. NOTE:        This routine assumes the process/application you specify
  101.              to open the object is currently running.
  102.  
  103. Example:     int err = MICI.OpenObject("HD:report.txt", "ttxt");
  104.              /* opens a file called report.txt using SimpleText */
  105.  
  106. -----------------------------
  107.  
  108. int = ExecuteScript(string inAppleScript);
  109.  
  110. Description: Executes a string of apple script.
  111. Parameters:  inAppleScript - AppleScript to execute.
  112. Returns:     returns any errors that occured or zero for no error.
  113.  
  114. Example:     auto myScript = "tell application \"Finder\"\r"
  115.                              "    open file \"HD:report.txt\"\r"
  116.                              "end tell";
  117.  
  118.              int err = MICI.ExecuteScript(myScript);
  119.  
  120.  
  121. -----------------------------
  122.  
  123. int = OSType(string inType);
  124.  
  125. Description: OSType("TEXT") returns 'TEXT' as a int.
  126. Parameters:  inType - type string to convert to int.
  127. Returns:     int value of inType
  128.  
  129. Example:     int type = MICI.OSType("TEXT");
  130.  
  131. -----------------------------
  132.